#ifndef STATUSMESSAGEDIALOG_H_
#define STATUSMESSAGEDIALOG_H_

#include <wx/wx.h>
#include "BuddyList.h"
#include <wx/treectrl.h>
#include <vector>
#include <map>
#include <wx/combobox.h>

namespace Impp
{

enum{

	STATUS_TREE_ID = wxID_HIGHEST +1,
	STATUS_TREE_ITEM_DELETE,
	NEW_SAVE
};

class StatusMessageDialog : public wxFrame
{
private:
	BuddyList* buddyList;
	wxTextCtrl* msgText;
	wxTreeCtrl* statusTree;
	wxButton* btOk;
	wxButton* newSave;
	wxTreeItemId rootID;
	wxTreeItemId newStatusMsgId;
	wxStaticBitmap* statusIcon;
	wxStaticText* statusTxt;
	//wxComboBox* accountBox;
	std::vector<StatusAndMsg*> messages;
	std::map<wxTreeItemIdValue, db_id> treeMap;
	bool dontSaveOnSelectionChanged;
	//std::vector<Account*> accounts;
	db_id curAccountId;

public:
	StatusMessageDialog(BuddyList* buddyList, db_id accountId);
	virtual ~StatusMessageDialog();
	void onOK(wxCommandEvent & event);
	void onSaveAs(wxCommandEvent & event);
	void onSelectionChanged(wxTreeEvent & event);
	void onContextMenu(wxTreeEvent & event);
	void onDeleteItem(wxCommandEvent & event);
	void onStatusMouseDown(wxMouseEvent& event);
	void onStatusSelected(wxCommandEvent & event);
	void onExtendedStatusSelected(wxCommandEvent & event);
	StatusAndMsg* getStatusAndMsgBy(wxTreeItemId id);

private:
	StatusAndMsg* updateTreeForAccount(db_id accountId);

private:
	DECLARE_EVENT_TABLE()
};

}

#endif /*STATUSMESSAGEDIALOG_H_*/
